import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Register from "../components/Register";
import Login from "../components/Login";
import Home from "../components/home/Home";
import Index from "../components/Index";
import Country from "../components/country/Country"

import CheckCountry  from "../components/country/CheckCountry"
import Service from "../components/common/Service"

Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      name: 'Index',
      component: Index,
      redirect:'/home',
      children: [
        {
          path: '/home',
          name: 'Home',
          component: Home,
        },
        {
          path: '/country',
          name: 'Country',
          component: Country,
          meta: {
            requireAuth:true
          }
        },
        {
          path: '/checkCountry',
          name: 'CheckCountry',
          component: CheckCountry
        },
        {
          path: '/service',
          name: 'Service',
          component: Service
        }
      ]
    },
  ]
})
